<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var num = 100 //余额
        do {
            var atm = prompt('请输入您要的操作: \n 1.存钱 \n 2.取钱\n 3.显示余额\n 4.退出')
            if (atm == 1) {
                var i = prompt('要存多少钱')
                num += parseFloat(i)
                alert('您余额还有' + num + '元')
            } else if (atm == 2) {
                var q = prompt('您要取多少钱呢')
                num -= q
                alert('您余额还有' + num + '元')
            } else if (atm == 3) {
                alert('您余额还有' + num + '元')
            }
        } while (atm != 4)
    </script>
</body>

</html>